<template>
  <div>
      <button @click="isShow = !isShow">显示/隐藏</button>
      <transition name="hello" :appear="true">
          <h5 v-show="isShow" >hello</h5>
      </transition>
      
  </div>
</template>

<script>
    export default {
        name:'Test',
        data() {
            return {
                isShow:true
            }
        },
    }
</script>

<style scoped>
    h5 {
        background-color: blue;
    }

    .hello-enter-active{
        animation: testTitle 1s linear;
    }
    .hello-leave-active{
        animation: testTitle 1s linear reverse;
    }
    @keyframes testTitle {
        from{
            /* 从左往右 */
            transform: translateX(100%);
        }
        to{
            transform: translateX(0px);
        }
    }
</style>